<?php defined('BASEPATH') OR exit('No direct script access allowed');

class Migration_add_table_ci_like extends CI_Migration {

  public function up()
  {
    // Drop table 'ci_like' if it exists   
    $this->dbforge->drop_table('ci_like');

    // Table structure for table 'ci_like'
    $this->dbforge->add_field(array(
      'lik_id' => array(
        'type' => 'INT',
        'constraint' => '11',
        'unsigned' => TRUE,
        'auto_increment' => TRUE
      ),
      'lik_pos_id' => array(
        'type' => 'INT',
        'constraint' => '11'
      ),
      'lik_usr_id' => array(
        'type' => 'MEDIUMINT',
        'constraint' => '8'
      ),
      'lik_com_id' => array(
        'type' => 'INT',
        'constraint' => '11'
      ),
      'lik_date' => array(
        'type' => 'DATETIME'
      )
    ));
    $this->dbforge->add_key('lik_id', TRUE);
    $this->dbforge->create_table('ci_like');
  }

  public function down()
  {
    $this->dbforge->drop_table('ci_like');
  }

}